//教师/助教课程界面链接赋值
var changeUrl = function(id) {
	$(".course-index-con-list #task").attr("href",CONTEXT_PATH + "task/list?courseId=" + id);
	$(".course-index-con-list #assistant").attr("href",CONTEXT_PATH + "accontrol/listAssistant?id=" + id);
	$(".course-index-con-list #grade").attr("href",CONTEXT_PATH + "studentGradeView/listData?courseId=" + id);
	$(".course-index-con-list #resource").attr("href",CONTEXT_PATH + "respository/listData?courseId=" + id);
	$(".course-index-con-list #answer").attr("href",CONTEXT_PATH + "" + id);
	$(".course-index-con-list #assi-task").attr("href",CONTEXT_PATH + "taskPersonAssistantList/listData?courseId=" + id);



}
//教师/助教课堂界面链接赋值
var changeLessonUrl = function(id) {
	$("#classroom-href-resource").attr("href",CONTEXT_PATH + "lessonResource/listTResource?lessonId=" + id);
	$("#classroom-href-task").attr("href",CONTEXT_PATH + "lessonTaskView/tlview?lessonId=" + id);
	$("#classroom-href-share").attr("href",CONTEXT_PATH + "shareTaskView/tlistData?lessonId=" + id);
}

//时间格式修改
var parseDate = function(s){
	var now = new Date();
	 now.setFullYear(parseInt(s.substring(0, 4)));
     now.setMonth(parseInt(s.substring(5, 7)) - 1);
     now.setDate(parseInt(s.substring(8, 10)));
     now.setHours(parseInt(s.substring(11, 13)));
     now.setMinutes(parseInt(s.substring(14, 16)));
     return timeStamp2String(now);
}
function timeStamp2String(datetime){
    var year = datetime.getFullYear();
    var month = datetime.getMonth() + 1 < 10 ? "0" + (datetime.getMonth() + 1) : datetime.getMonth() + 1;
    var date = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate();
    var hour = datetime.getHours()< 10 ? "0" + datetime.getHours() : datetime.getHours();
    var minute = datetime.getMinutes()< 10 ? "0" + datetime.getMinutes() : datetime.getMinutes();
    var second = datetime.getSeconds()< 10 ? "0" + datetime.getSeconds() : datetime.getSeconds();
    return year + "-" + month + "-" + date+" "+hour+":"+minute;
}
